{include file="public/layout" /}
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page min-hg-c-10">
    {include file="vertify/bar" /}
    <form class="form-horizontal" id="post_form" action="" method="post">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="guestbook_is_on">是否启用</label>
                </dt>
                <dd class="opt">
                    <label class="curpoin"><input id="guestbook_is_on1" name="captcha[guestbook][is_on]" value="1" type="radio" {if condition='!empty($row.is_on)'}checked="checked"{/if}>启用</label>
                    <label class="curpoin"><input id="guestbook_is_on0" name="captcha[guestbook][is_on]" value="0" type="radio" {if condition='empty($row.is_on)'}checked="checked"{/if}>关闭</label>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a id="GuestBook" href="javascript:void(0);" onclick="GuestBook();" {if condition='empty($row.is_on)'}style="display:none;"{/if}>[标签调用]</a>
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>            
            <dl class="row">
                <dt class="tit">
                    <label for="guestbook_codeSet">预置字符</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="captcha[guestbook][config][codeSet]" placeholder="验证码预置字符" value="{$row.config.codeSet|default=$row.default.codeSet}" id="codeSet" class="input-txt" onkeyup="this.value=this.value.replace(/[^\w]/g,'');" onpaste="this.value=this.value.replace(/[^\w]/g,'')">
                    <span class="err"></span>
                    <p class="notic">仅支持英文字母、数字</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="guestbook_fontSize">字号大小</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="captcha[guestbook][config][fontSize]" placeholder="验证码字体大小(px)" value="{$row.config.fontSize|default=$row.default.fontSize}" id="fontSize" class="input-txt">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="guestbook_useCurve">混淆曲线</label>
                </dt>
                <dd class="opt">
                    <label class="curpoin"><input id="guestbook_useCurve1" name="captcha[guestbook][config][useCurve]" value="1" type="radio" {if condition="$row.config.useCurve == '1'"}checked="checked"{/if}>开</label>
                    <label class="curpoin"><input id="guestbook_useCurve0" name="captcha[guestbook][config][useCurve]" value="0" type="radio" {if condition="empty($row.config.useCurve)"}checked="checked"{/if}>关</label>
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="guestbook_useNoise">添加杂点</label>
                </dt>
                <dd class="opt">
                    <label class="curpoin"><input id="guestbook_useNoise1" name="captcha[guestbook][config][useNoise]" value="1" type="radio" {if condition="$row.config.useNoise == '1'"}checked="checked"{/if}>是</label>
                    <label class="curpoin"><input id="guestbook_useNoise0" name="captcha[guestbook][config][useNoise]" value="0" type="radio" {if condition="empty($row.config.useNoise)"}checked="checked"{/if}>否</label>
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="guestbook_length">显示位数</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="captcha[guestbook][config][length]" placeholder="验证码图片高度" value="{$row.config.length|default=$row.default.length}" id="length" class="input-txt" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\[^0-9]/g,''));">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <div class="bot">
                <input type="hidden" name="inc_type" id="inc_type" value="{$inc_type|default='default'}">
                <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    $('input[name="captcha[guestbook][is_on]"]').click(function(){
        var guest_book = $(this).val();
        if (1 == guest_book) {
            $('#GuestBook').show();
        } else {
            $('#GuestBook').hide();
        }
    });

    function GuestBook(){
        var url = "https://www.eyoucms.com/plus/view.php?aid=8056&origin_eycms=1";
        //iframe窗
        layer.open({
            type: 2,
            shade: layer_shade,
            title: '留言模型验证码调用',
            shadeClose: false,
            maxmin: false, //开启最大化最小化按钮
            area: ['700px;', '500px'],
            content: url
        });
    }

    // 判断输入框是否为空
    function checkForm(){
        if($('#codeSet').val() == ''){
            showErrorMsg('预置字符不能为空');
            $('#codeSet').focus();
            return false;
        }
        if($('#fontSize').val() == '' || 0 == $('#fontSize').val()){
            showErrorMsg('字体大小必须大于0');
            $('#fontSize').focus();
            return false;
        }
        if($('#length').val() == '' || 0 == $('#length').val()){
            showErrorMsg('显示位数必须大于0');
            $('#length').focus();
            return false;
        } else if ($('#length').val() > 8) {
            showErrorMsg('显示位数不能大于8');
            $('#length').focus();
            return false;
        }

        layer_loading('正在处理');
        $('#post_form').submit();
    }
</script>
{include file="public/footer" /}
